<!--
  ~  Copyright 2015 PayPal
  ~
  ~  Licensed under the Apache License, Version 2.0 (the "License");
  ~  you may not use this file except in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~  http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing, software
  ~  distributed under the License is distributed on an "AS IS" BASIS,
  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  See the License for the specific language governing permissions and
  ~  limitations under the License.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Bottle Events</title>
</head>
<body style="font-family:Verdana,Arial,sans-serif;">
<h3 style="color:red;">Kudos to <a href="http://99-bottles-of-beer.net/" target="_">http://99-bottles-of-beer.net/</a></h3>
<div id="eventDisplay" style="color:blue;">Waiting</div>
<script>
var target = document.getElementById("eventDisplay");
var source = new EventSource('/bottles/events');
source.addEventListener('lyric', function(e) {
	var lyric = e.data.split('\n').join('<br/>');
	target.innerHTML = lyric;
}, false);
source.addEventListener('streamEnd', function(e) {
	source.close();
}, false);
</script>
</body>
</html>